<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
var isReceiveFlow = false;
$(function(){

	if(typeof(_processId) != "undefined" && _processId != null){
		if(_processId.indexOf("DOC_ReceiveFlow") == 0 || _processId == "DOC_DeptReadFlow"){
			isReceiveFlow = true;
		}
	}
	
	//表格加载
	$('#synFormNumberLogTable').datagrid({
	    url:'<c:url value="/synNumber/unusedDisplayNumberData" />',
	    queryParams:getSynFormNumberLogParams(),//提交参数
	    
//	    toolbar:'#synFromToolbar',//表头工具栏
//	    pagination:true,//显示分页  
//	    pagePosition:'bottom',//分页栏出现位置
//	    pageNumber:1,//初始页码
//	    pageSize:10,//初始每页显示记录数量
	    singleSelect:true,
	    nowrap:false,//列的内容超出所定义的列宽时,自动换行
	    fitColumns:true,//设置为 true，则会自动扩大或缩小列的尺寸以适应网格的宽度并且防止水平滚动。
	    columns:[[
			{field:'numberLogId',title:'序号',width:"30%",formatter: function(value,row,index){
				return (index+1);
			}},
			{field:'numberContent',title:'发文号',width:"70%",formatter: function(value,row,index){
				var numStr="";
				if(value!="" && value!="null" && value!=null){
					numStr=value;
				}else{
					if(isReceiveFlow){
						numStr=row.groupId+row.numberValue;
			         } else {
			              if('辽烟通报'== row.groupId || '辽烟信息' == row.groupId){
			            	  numStr=row.groupId+" "+row.numberYear+" 第 "+row.numberValue+" 期";
			              }else if('培训'== row.groupId ){
			            	  numStr=row.groupId;
			              }else if('信访登记'== row.groupId ){
			            	  numStr=row.groupId+"〔"+row.numberYear+"〕第"+row.numberValue+"号";
			              }else{
			            	  numStr=row.groupId+"〔"+row.numberYear+"〕"+row.numberValue+"号";
			              }
			         }
				}
				return numStr;
			}}
	    ]]
	});
});

function getSynFormNumberLogParams(){
	var obj=new Object();
	obj.numberId="<c:out value='${numberId}' />";
	return obj;
}